﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CashierSystem.CheckItemManager
{
    public partial class UpdateItemForm : Form
    {
        public UpdateItemForm()
        {
            InitializeComponent();
        }

        string[] departId;
        string[] departName;
        string[] doctorId;
        string[] doctorName;

        private void UpdateItemForm_Load(object sender, EventArgs e)
        {
            CashierInManager.CashierInManager.getDepartInfo(out departName, out departId);
            cbDepartment.Items.Clear();
            for (int i = 0; i < departId.Length; i++)
            {
                cbDepartment.Items.Add(departName[i]);
            }
            int j = cbDepartment.SelectedIndex;
            string departId1 = departId[j];
            CheckItemManager.getDoctorInfo(out doctorName, out doctorId,departId1);
            cbDoctor.Items.Clear();
            for (int i = 0; i < doctorId.Length; i++)
            {
                cbDoctor.Items.Add(doctorName[i]);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int i = cbDepartment.SelectedIndex;
            string departId1 = "";
            if (i != -1)
            {
                departId1 = departId[i];
            }
            else
            {
                departId1 = "";
            }
            string itemName = tbItemName.Text;
            CheckItemManager.getItemList(listView1, departId1, itemName);

            
        }

    }
}